﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport"/>
    <meta content="yes" name="apple-mobile-web-app-capable"/>
    <meta content="black" name="apple-mobile-web-app-status-bar-style"/>
    <meta content="telephone=no" name="format-detection"/>
    <title>新方向</title>
    <link rel="stylesheet" href="css/ydui.css">
    <link rel="stylesheet" href="css/style.css">
    <script src='js/adaption.js'></script>

</head>
<body>
<header class="m-navbar android-bar">
    <i class="back icon-back"></i>
    <div class="navbar-center">
        <span class="navbar-title">新方向教育</span>
    </div>
</header>

<div class="order-status-tip">
    <i class="icon-waitpay"></i>
    <div class="txt">
        <h2>订单未支付</h2>
        <p>5日后自动删除订单</p>
    </div>
</div>

<a class="course-list order-box" href="course.html">
    <div class="thumbnail">
        <img src="images/course-thumbnail01.png" alt="xx课程">
    </div>
    <div class="course-txt">
        <p class="course-name">课程名称课程名称课程名称</p>
        <span class="description">副标题副标题副标题</span>
        <p class="price">¥ 1180.00</p>
    </div>
</a>
<section class="section order-price-box">
    <p>合计：<span class="price">¥ 1180.00</span></p>
</section>

<section class="section  order-time-box">
    <p>订单编号：23422017102021098789</p>
    <p>下单时间：2018-10-20   10:35</p>
</section>

<div class="page-detail-footer operate-box" data-orderid="binggan0101">
    <button type="button" class="cancel-order-btn">取消订单</button>
    <a href="order.html" class="pay-order-btn">立即支付</a>
</div>

<script src="js/jquery.min.js"></script>
<script src="js/ydui.js"></script>
<script src="js/main.js"></script>
<script>
    $(function () {
        var dialog = YDUI.dialog;

        (function () {
            var $cancel = $(".cancel-order-btn");
            //取消订单
            $cancel.on('click', function () {
                deleteOrder.apply(this,['','请确认是否取消订单！'])

            });

            /*
            *删除订单FUNC*/
            function deleteOrder(url,ordertip) {
                var self = $(this);
                var parent = self.parents(".operate-box"),
                    orderid = parent.data('orderid');
                dialog.confirm('订单操作提示', ordertip, function () {
                    bingUtil.myAjax({
                        url: url,
                        type: 'post',
                        data:{"orderId":orderid},
                        callback: function (res) {
                            //服务器取消并删除成功响应
                            //dialog.toast('订单操作成功！', 'success', 1000);
                            window.location.href='person.html'
                        }
                    });
                });
            }

        })()

    });

</script>
</body>
</html>
